#include<string>
#include<vector>
#include<iostream>
using namespace std;

class Meal
{
	string name;
	float price;
	int poplv;
public:
	Meal(string n="",float p=0,int pl=0){name=n;price=p;poplv=pl;}
	string getName(){return name;}
	float getPrice(){return price;}
	int getPop(){return poplv;}
	bool setPrice(float p)
	{
		if(p>0&&p<100) {price=p;return true;}
		return false;
	}
	bool setPop(int p)
	{
		if(p>=0&&p<=10) {poplv=p;return true;}
		return false;
	}
	friend ostream& operator<<(ostream& output,Meal& x)
	{
		output<<"Meal Name:"<<x.name<<", Price:"<<x.price;
		output<<", Popular Level:"<<x.poplv;
		return output;
	}
};

class Eatery
{
	string host;
public:
	vector<Meal> meals;
	Eatery(string h=""){host=h;}
	//~Eatery(){delete &host;delete &meals;}
	string getHost(){return host;}
};

class SnackCart :public Eatery
{
	string place;
public:
	SnackCart(string h="",string p=""):Eatery(h){place=p;}
	string getPlace(){return place;}
	friend ostream& operator<<(ostream& output,SnackCart& x)
	{
		output<<"Host:"<<x.getHost()<<", Place:"<<x.place;
		return output;
	}
};

class Restaurant :public Eatery
{
	string name,place,phonenumber,time;
public:
	Restaurant(string h,string n,string p,string pn,string t):Eatery(h)
	{name=n;place=p;phonenumber=pn;time=t;}
	friend ofstream& operator<<(ofstream& of,Restaurant& x)
	{
		of<<x.name<<endl<<x.getHost()<<endl<<x.phonenumber<<endl<<x.time;
		return of;
	}
	friend ostream& operator<<(ostream& output,Restaurant& x)
	{
		output<<"\tName:"<<x.name<<", Host:"<<x.getHost()<<", Place:"<<x.place;
		output<<"\n\tPhone Number:"<<x.phonenumber<<", Open Time: "<<x.time;
		return output;
	}
};

